home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 June (Extra) / CHIP 2006-06.3.iso / program / opensource / clamav-devel.exe / contrib / Windows / clamserver.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-05-16  |  1.9 KB  |  53 lines

  1. // Maintains connection to the clamd server
  2.  
  3. /*
  4.  *  Copyright (C) 2004 Nigel Horne <njh@bandsman.co.uk>
  5.  *
  6.  *  This program is free software; you can redistribute it and/or modify
  7.  *  it under the terms of the GNU General Public License as published by
  8.  *  the Free Software Foundation; either version 2 of the License, or
  9.  *  (at your option) any later version.
  10.  *
  11.  *  This program is distributed in the hope that it will be useful,
  12.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *  GNU General Public License for more details.
  15.  *
  16.  *  You should have received a copy of the GNU General Public License
  17.  *  along with this program; if not, write to the Free Software
  18.  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  19.  *  MA 02110-1301, USA.
  20.  */
  21. #ifndef    _CLAMSERVER_H
  22.  
  23. #include "mainfrm.h"
  24.  
  25. class ClamServer {
  26.  
  27. public:
  28.     ClamServer(void);
  29.     ClamServer(CString& serverName, unsigned short port);
  30.     ~ClamServer();
  31.     BOOL    Scan(const CString& filename, int level, CMainFrame *mainFrame,
  32.         CWnd *parent, BOOL recursive, const CString& qDir);
  33.         // returns TRUE if the file is clean
  34.  
  35. private:
  36.     BOOL    InitInstance(void);
  37.     int        CreateConnection(void);
  38.     const    BOOL    CheckConnection(int sock);
  39.     BOOL    ClamServer::ScanFolder(const CString& string, int level, CMainFrame *mainFrame,
  40.         CWnd *parent, BOOL recursive, const CString& qDir);
  41.     BOOL    ClamServer::ScanWildCard(const CString& string, int level, CMainFrame *mainFrame,
  42.         CWnd *parent, BOOL recursive, const CString& qDir);
  43.     int        ClamServer::ClamdRecv(int sock, char *buf, size_t len, int timeout = 30);
  44.  
  45.     long    serverIP;    // IPv4 address of the clamdserver (only one for now)
  46.     unsigned short    port;    // host order
  47.     BOOL    stopping;    // true if the application has been asked to stop
  48.     CProgress    *progressBar;
  49. };
  50.  
  51. #define    _CLAMSERVER_H
  52. #endif    _CLAMSERVER_H
  53.